package com.si.entite;

public class Cavalier extends Piece {
        String pathImage1= "./src/com/ChessApps/images/2.gif";
        String pathImage2= "./src/com/ChessApps/images/8.gif";
        
	public Cavalier(String couleur) {
		this.couleur= couleur;
	}

	@Override
	public boolean validerDep(Position posDepart, Position posFinal) {
		int diffColonne= posFinal.x-posDepart.x;
		int diffLigne= posFinal.y-posDepart.y;
		if(this.validerEchec(posFinal)){
		if ((((diffLigne==1)||(diffLigne==-1))&&((diffColonne==2)||(diffColonne==-2)))||
			(((diffLigne==2)||(diffLigne==-2))&&((diffColonne==1)||(diffColonne==-1))))
			return true;
		return false;
                }else return false; 
        }
        

	
	public boolean manger(Position posDepart, Position posFinal) {
		// TODO Auto-generated method stub
		return false;
	}

        public String toString(){return "Cavalier";}

    @Override
    public String getPathImage(int i) {
       if (i== 1)
        {
            return pathImage1;
        }
        else {return pathImage2;}
    }



}
